package com.abbas.abchat.adapter;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * @author abbas
 * @description: TODO
 * @date 2022/4/13 16:05
 */
public class HomeVpAdapter extends FragmentStatePagerAdapter {

    private Context mContext;
    private List<Fragment> mPages;


    public HomeVpAdapter(@NonNull FragmentManager fm,Context context,List<Fragment> pages) {
        super(fm);
        mContext = context;
        mPages = pages;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return mPages.get(position);
    }

    @Override
    public int getCount() {
        return mPages.size();
    }
}
